<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p id="p1"></p>
    <script>
        var p = document.getElementById('p1');
                // p.innerHTML = count;
                let x = 6;
                var timer1 = setInterval(() => {
                    p.innerHTML = `倒计时${--x}`; 
                    if(x == 0){
                        clearInterval(timer1);
                        alert('boom！！')
                    }
                }, 1000);
            
      
    </script>
</body>
</html>